package com.springboot.learning.framework.web.page;

import java.io.Serializable;
import java.util.LinkedHashMap;


public class PaginationSupport  implements Serializable {
	
	private static final long serialVersionUID = 1422741060880271847L;

	/**
	 * 当前第几页
	 */
	private int currentPage = 0;
	
	/**
	 * 每页显示记录数
	 */
	private int pageSize = 20;
	
	/**
	 * 是否需要获取总记录数
	 */
	private boolean requiredTotalSize = true;
	
	private LinkedHashMap<String,String> orderByMap;

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
//		if (currentPage > 0)
//			currentPage--;
		this.currentPage = currentPage;
	}

	public boolean isRequiredTotalSize() {
		return requiredTotalSize;
	}

	public void setRequiredTotalSize(boolean requiredTotalSize) {
		this.requiredTotalSize = requiredTotalSize;
	}

	public LinkedHashMap<String, String> getOrderByMap() {
		return orderByMap;
	}

	public void setOrderByMap(LinkedHashMap<String, String> orderByMap) {
		this.orderByMap = orderByMap;
	}

}

